package org.wei.p2p.common.domain;


/**
 * @author wei
 */
public class PageRequestParams {

    private Integer startRow;

    private Integer limit;

    private PageRequestParams(Integer startRow, Integer limit) {
        this.startRow = startRow;
        this.limit = limit;
    }

    public static PageRequestParams of(Integer pageNo, Integer pageSize) {
		Integer startRow = (pageNo - 1) * pageSize;
        return new PageRequestParams(startRow, pageSize);
    }

    public Integer getStartRow() {
        return startRow;
    }

    public void setStartRow(Integer startRow) {
        this.startRow = startRow;
    }

    public Integer getLimit() {
        return limit;
    }

    public void setLimit(Integer limit) {
        this.limit = limit;
    }


}
